package gew.data;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

public class IndicatorGraphItem {
    private final static int YEAR = 1;
    private final int yearId;
    private final ArrayList<IndicatorGraphItemDetail> details;

    public IndicatorGraphItem(ResultSet rs, int colCount) throws SQLException {
        this.yearId = rs.getInt(YEAR);
        details = new ArrayList<>();
        for (int i = YEAR + 1; i < colCount + 1; i++){
            details.add(new IndicatorGraphItemDetail(rs.getString(i)));
        }
    }

    public int getYearId() {
        return yearId;
    }

    public Iterable<IndicatorGraphItemDetail> getDetails() {
        return details;
    }    
    
}
